<template>
  <div>
    <el-button type="primary"><a href="https://etest4.spdb.com.cn/msent-web-net/PreBatchOtherLogin.do?channel=0000&callback=http://gz.haogzl.com/getToken">去ie获取token</a></el-button>
    ie获取的token：{{token}}<br>

    <el-button style="margin-top:20px" type="primary" @click="button1Click"><a :href="url">通过动态链接库获取token</a></el-button><br>
    <!-- <el-button style="margin-top:20px" type="primary" @click="getGpy">高拍仪</el-button> -->
  </div>
</template>

<script >

// import gpyjs from '@/utils/gpyjs'
export default {
  data(){
    return{
      token:'',
      url:''
    }
  },
  created(){
    if(window.location.search){
      this.data.token=this.GetQueryString('token')
    }
  },
  methods:{
    // getGpy:function(){
    //   gpyjs.begin()
    // },
    GetQueryString:function (name) {
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
      console.log(reg);
      var l = decodeURI(window.location.search);
      var r = l.substr(1).match(reg);  //获取url中"?"符后的字符串并正则匹配
      console.log(r);
      var context = ""; 
      if (r !== null) context = r[2]; 
      console.log(context);
      return context === null || context ==="" || context === "undefined" ? "" : context; 
    },
    button1Click:function(){
      var d = new Date()
      // console.log(d.getDate());
      console.log(window.location);
      var clientNo='e0490c68-a8f8-4b9f-8287-d6db4c30a224~|~companyId=98250203~|~lgnName=陈曙~|~mobile=13343461836~|~keyValue=HaogZL~|~'
      // var prestr = "~|~_signtimestamp=" +datestr +"~|~";
      // var tokenurl = "Token://hello";
		 this.url = tokenurls
    }
  }
}

</script>